window.onscroll = function() {
    var header = document.getElementById('header');
    var num = document.body.scrollTop || document.documentElement.scrollTop;
    if (num > 30) {
        header.style.backgroundColor = '#e43130';
    } else {
        header.style.backgroundColor = 'transparent';
    }
}